<template>
  <div>

    <el-breadcrumb separator-class="el-icon-arrow-right">
      <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
      <el-breadcrumb-item>IPA</el-breadcrumb-item>
      <el-breadcrumb-item>关联App Store</el-breadcrumb-item>
      <el-breadcrumb-item>添加App Store账户</el-breadcrumb-item>
    </el-breadcrumb>

    <div class="add_account">


      <el-form :label-position="labelPosition" label-width="80px" :model="addAccountData" style="overflow:auto"
               :rules="rules" ref="formLabelAlign">
        <el-form-item class="add_account_itme" label="名称" prop="name">
          <el-input class="mdkc-imput" v-model="addAccountData.name"></el-input>
        </el-form-item>
        <el-form-item label="账号" prop="account">
          <el-input v-model="addAccountData.account"></el-input>
        </el-form-item>
        <el-form-item label="密码" prop="password">
          <el-input v-model="addAccountData.password"></el-input>
        </el-form-item>
        <el-form-item label="issID" prop="issid">
          <el-input v-model="addAccountData.issid"></el-input>
        </el-form-item>
        <el-form-item label="秘钥" prop="secretkey">
          <el-input v-model="addAccountData.secretkey"></el-input>
        </el-form-item>
        <el-form-item label="私钥" prop="privatekey">
          <el-input v-model="addAccountData.privatekey"></el-input>
        </el-form-item>
        <el-form-item>

          <el-button type="primary" @click="submitForm">保存</el-button>
        </el-form-item>


      </el-form>


    </div>
  </div>
</template>

<script>
  export default {
    name: "AddAccount",
    created(){
      this.getParams()
    },
    data() {
      return {
        labelPosition: 'right',
        rules: {
          name: [
            {required: true, message: '请输入活动名称', trigger: 'blur'},
            {min: 10, max: 20, message: '长度在 3 到 5 个字符', trigger: 'blur'}
          ],
          account: [
            {required: true, message: '请输入活动名称', trigger: 'blur'},
            {min: 10, max: 20, message: '长度在 3 到 5 个字符', trigger: 'blur'}
          ],
          password: [
            {required: true, message: '请输入活动名称', trigger: 'blur'},
            {min: 10, max: 20, message: '长度在 3 到 5 个字符', trigger: 'blur'}
          ],
          issid: [
            {required: true, message: '请输入活动名称', trigger: 'blur'},
            {min: 10, max: 20, message: '长度在 3 到 5 个字符', trigger: 'blur'}
          ],
          secretkey: [
            {required: true, message: '请输入活动名称', trigger: 'blur'},
            {min: 10, max: 20, message: '长度在 3 到 5 个字符', trigger: 'blur'}
          ],
          privatekey: [
            {required: true, message: '请输入活动名称', trigger: 'blur'},
            {min: 10, max: 20, message: '长度在 3 到 5 个字符', trigger: 'blur'}
          ],
          getParams(){},
          addAccountData:{}
        }
      };
    },
    methods: {
      submitForm() {
        this.$router.push("/")
        // alert(1111)
      },
      getParams () {
        const obj = this.$route.params
        // console.log(obj.object.name)
        this.addAccountData = obj.object;
        // console.log(obj.name)
        // console.log(this.addAccountData.name)

        // var routerParams = this.$route.params.objiec
        // this.id = routerParams
      }
    },
    watch:{
      '$route':'getParams'
    }
  }
</script>

<style scoped>
  .add_account {
    height: 460px;
    width: 300px;
    /*background-color: aliceblue;*/
    margin: 40px auto;
  }

  .ch {
    margin-top: 20px;
  }

  .add_account_itme {

    /*box-sizing: border-box;*/
    margin-top: 20px;
    margin-right: 20px;
    line-height: 30px;
  }

  .el-input {
    height: 30px;
  }

  .el-form-item {

    margin-right: 20px;
  }

  .el-button {
    margin-right: 100px;
  }
</style>
